home *** CD-ROM | disk | FTP | other *** search
/ Aminet 2 / Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso / Aminet / dev / gcc / geninline_920614.lha / inline-2.0 / rexxsyslib.h < prev    next >
C/C++ Source or Header  |  1992-06-14  |  5KB  |  162 lines

  1. #ifndef _INLINE_REXXSYSLIB_H
  2. #define _INLINE_REXXSYSLIB_H
  3.  
  4. #include <sys/cdefs.h>
  5. #include <inline/stubs.h>
  6.  
  7. __BEGIN_DECLS
  8.  
  9. #ifndef BASE_EXT_DECL
  10. #define BASE_EXT_DECL extern struct RexxSysBase*  RexxSysBase;
  11. #endif
  12. #ifndef BASE_PAR_DECL
  13. #define BASE_PAR_DECL
  14. #define BASE_PAR_DECL0 void
  15. #endif
  16. #ifndef BASE_NAME
  17. #define BASE_NAME RexxSysBase
  18. #endif
  19.  
  20. static __inline void 
  21. ClearRexxMsg (BASE_PAR_DECL struct RexxMsg *msgptr,unsigned long count)
  22. {
  23.   BASE_EXT_DECL
  24.   register struct RexxSysBase* a6 __asm("a6") = BASE_NAME;
  25.   register struct RexxMsg *a0 __asm("a0") = msgptr;
  26.   register unsigned long d0 __asm("d0") = count;
  27.   __asm __volatile ("jsr a6@(-0x9c)"
  28.   : /* no output */
  29.   : "r" (a6), "r" (a0), "r" (d0)
  30.   : "a0","a1","d0","d1");
  31.   *(char *)a0 = *(char *)a0;
  32. }
  33. static __inline UBYTE *
  34. CreateArgstring (BASE_PAR_DECL UBYTE *string,unsigned long length)
  35. {
  36.   BASE_EXT_DECL
  37.   register UBYTE * _res  __asm("d0");
  38.   register struct RexxSysBase* a6 __asm("a6") = BASE_NAME;
  39.   register UBYTE *a0 __asm("a0") = string;
  40.   register unsigned long d0 __asm("d0") = length;
  41.   __asm __volatile ("jsr a6@(-0x7e)"
  42.   : "=r" (_res)
  43.   : "r" (a6), "r" (a0), "r" (d0)
  44.   : "a0","a1","d0","d1");
  45.   *(char *)a0 = *(char *)a0;
  46.   return _res;
  47. }
  48. static __inline struct RexxMsg *
  49. CreateRexxMsg (BASE_PAR_DECL struct MsgPort *port,UBYTE *extension,UBYTE *host)
  50. {
  51.   BASE_EXT_DECL
  52.   register struct RexxMsg * _res  __asm("d0");
  53.   register struct RexxSysBase* a6 __asm("a6") = BASE_NAME;
  54.   register struct MsgPort *a0 __asm("a0") = port;
  55.   register UBYTE *a1 __asm("a1") = extension;
  56.   register UBYTE *d0 __asm("d0") = host;
  57.   __asm __volatile ("jsr a6@(-0x90)"
  58.   : "=r" (_res)
  59.   : "r" (a6), "r" (a0), "r" (a1), "r" (d0)
  60.   : "a0","a1","d0","d1");
  61.   *(char *)a0 = *(char *)a0;  *(char *)a1 = *(char *)a1;
  62.   return _res;
  63. }
  64. static __inline void 
  65. DeleteArgstring (BASE_PAR_DECL UBYTE *argstring)
  66. {
  67.   BASE_EXT_DECL
  68.   register struct RexxSysBase* a6 __asm("a6") = BASE_NAME;
  69.   register UBYTE *a0 __asm("a0") = argstring;
  70.   __asm __volatile ("jsr a6@(-0x84)"
  71.   : /* no output */
  72.   : "r" (a6), "r" (a0)
  73.   : "a0","a1","d0","d1");
  74.   *(char *)a0 = *(char *)a0;
  75. }
  76. static __inline void 
  77. DeleteRexxMsg (BASE_PAR_DECL struct RexxMsg *packet)
  78. {
  79.   BASE_EXT_DECL
  80.   register struct RexxSysBase* a6 __asm("a6") = BASE_NAME;
  81.   register struct RexxMsg *a0 __asm("a0") = packet;
  82.   __asm __volatile ("jsr a6@(-0x96)"
  83.   : /* no output */
  84.   : "r" (a6), "r" (a0)
  85.   : "a0","a1","d0","d1");
  86.   *(char *)a0 = *(char *)a0;
  87. }
  88. static __inline BOOL 
  89. FillRexxMsg (BASE_PAR_DECL struct RexxMsg *msgptr,unsigned long count,unsigned long mask)
  90. {
  91.   BASE_EXT_DECL
  92.   register BOOL  _res  __asm("d0");
  93.   register struct RexxSysBase* a6 __asm("a6") = BASE_NAME;
  94.   register struct RexxMsg *a0 __asm("a0") = msgptr;
  95.   register unsigned long d0 __asm("d0") = count;
  96.   register unsigned long d1 __asm("d1") = mask;
  97.   __asm __volatile ("jsr a6@(-0xa2)"
  98.   : "=r" (_res)
  99.   : "r" (a6), "r" (a0), "r" (d0), "r" (d1)
  100.   : "a0","a1","d0","d1");
  101.   *(char *)a0 = *(char *)a0;
  102.   return _res;
  103. }
  104. static __inline BOOL 
  105. IsRexxMsg (BASE_PAR_DECL struct RexxMsg *msgptr)
  106. {
  107.   BASE_EXT_DECL
  108.   register BOOL  _res  __asm("d0");
  109.   register struct RexxSysBase* a6 __asm("a6") = BASE_NAME;
  110.   register struct RexxMsg *a0 __asm("a0") = msgptr;
  111.   __asm __volatile ("jsr a6@(-0xa8)"
  112.   : "=r" (_res)
  113.   : "r" (a6), "r" (a0)
  114.   : "a0","a1","d0","d1");
  115.   *(char *)a0 = *(char *)a0;
  116.   return _res;
  117. }
  118. static __inline ULONG 
  119. LengthArgstring (BASE_PAR_DECL UBYTE *argstring)
  120. {
  121.   BASE_EXT_DECL
  122.   register ULONG  _res  __asm("d0");
  123.   register struct RexxSysBase* a6 __asm("a6") = BASE_NAME;
  124.   register UBYTE *a0 __asm("a0") = argstring;
  125.   __asm __volatile ("jsr a6@(-0x8a)"
  126.   : "=r" (_res)
  127.   : "r" (a6), "r" (a0)
  128.   : "a0","a1","d0","d1");
  129.   *(char *)a0 = *(char *)a0;
  130.   return _res;
  131. }
  132. static __inline void 
  133. LockRexxBase (BASE_PAR_DECL unsigned long resource)
  134. {
  135.   BASE_EXT_DECL
  136.   register struct RexxSysBase* a6 __asm("a6") = BASE_NAME;
  137.   register unsigned long d0 __asm("d0") = resource;
  138.   __asm __volatile ("jsr a6@(-0x1c2)"
  139.   : /* no output */
  140.   : "r" (a6), "r" (d0)
  141.   : "a0","a1","d0","d1");
  142. }
  143. static __inline void 
  144. UnlockRexxBase (BASE_PAR_DECL unsigned long resource)
  145. {
  146.   BASE_EXT_DECL
  147.   register struct RexxSysBase* a6 __asm("a6") = BASE_NAME;
  148.   register unsigned long d0 __asm("d0") = resource;
  149.   __asm __volatile ("jsr a6@(-0x1ce)"
  150.   : /* no output */
  151.   : "r" (a6), "r" (d0)
  152.   : "a0","a1","d0","d1");
  153. }
  154. #undef BASE_EXT_DECL
  155. #undef BASE_PAR_DECL
  156. #undef BASE_PAR_DECL0
  157. #undef BASE_NAME
  158.  
  159. __END_DECLS
  160.  
  161. #endif /* _INLINE_REXXSYSLIB_H */
  162.